﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniErp.Model.Entities.AssetManagement
{
    /// <summary>
    /// 资产信息实体
    /// </summary>
    [Table("AssetInfo")]
    public class AssetInfoEntity
    {
        #region 资产编号
        /// <summary>
        /// 资产编号
        /// /// </summary>
        [MaxLength(5)]
        [MinLength(5)]
        public int AId { get; set; }
        /// <summary>
        /// 资产总类型编号
        /// </summary>
        [MaxLength(4)]
        [MinLength(4)]
        public int GeneralTypeId { get; set; }
        /// <summary>
        /// 资产次级类型编号
        /// </summary>
        [MaxLength(4)]
        [MinLength(4)]
        public int SecondaryTypeId { get; set; }
        #endregion

        /// <summary>
        /// 资产名
        /// </summary>
        [MaxLength(20), Required]
        public string AssetName { get; set; }

        /// <summary>
        /// 位置编号
        /// </summary>
        [MaxLength(6)]
        [MinLength(6)]
        public int PositionId { get; set; }
        /// <summary>
        /// 资产状态编号
        /// </summary>
        [MaxLength(1)]
        public int AssetStateId { get; set; }
        /// <summary>
        /// 资产所属人编号(工号)
        /// </summary>
        [MaxLength(6)]
        [MinLength(6)]
        public int UserInfoId { get; set; }
        /// <summary>
        /// 部门编号
        /// </summary>
        [MaxLength(6)]
        [MinLength(6)]
        public int DepartmentId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }

        /// <summary>
        /// 用户表导航属性
        /// </summary>
        public UserInfoEntity UserInfo { get; set; }
        /// <summary>
        /// 资产总类别表导航属性
        /// </summary>
        public GeneralTypeEntity GeneralType { get; set; }
        /// <summary>
        /// 资产次级类别表导航属性
        /// </summary>
        public SecondaryTypeEntity SecondaryType { get; set; }
        /// <summary>
        /// 资产状态表导航属性
        /// </summary>
        public AssetStateEntity AssetState { get; set; }
        /// <summary>
        /// 位置信息表导航属性
        /// </summary>
        public PositionEntity Position { get; set; }
        /// <summary>
        /// 部门信息表导航属性
        /// </summary>
        public DepartmentEntity Department { get; set; }
    }
}
